﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Master/AdminMaster.Master" AutoEventWireup="true" CodeBehind="PurchaseCompanyUpdate.aspx.cs" Inherits="HZ.DrugTrade.Web.Admin.DrugLibManage.PurchaseCompanyUpdate" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <script type="text/javascript" language="javascript">
        function SetValue(objRadio) {
            var hfdHospitalInfo = document.getElementById("ctl00_ContentPlaceHolder1_hfdHospitalInfo");
            if (hfdHospitalInfo.value != "") {
                hfdHospitalInfo.value = "";
            }
            hfdHospitalInfo.value = objRadio.value;
        }

        function checkRadioItems(obj, info) {
            var retValue = false;
            var allCheckObj = document.getElementById(obj);
            var inputs = allCheckObj.getElementsByTagName("input")
            for (j = 0; j < inputs.length; j++) {
                if (inputs[j].type == "radio") {
                    if (inputs[j].disabled == false && inputs[j].checked == true)
                    { retValue = true; break; }
                }

            }
            if (!retValue) { alert(info); } return retValue;
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="maincon">
        <div class="note">
            设置产品默认配送</div>
        <div class="note2">
        </div>
        <table>
            <tr>
                <th style="width: 100px;">
                    <asp:Label ID="lblGoodsName1" runat="server" Text="产品名称："></asp:Label>
                </th>
                <td align="center">
                    <asp:Label runat="server" ID="lblGoodsName"></asp:Label>
                </td>
                <th style="width: 100px;">
                    <asp:Label ID="lblGg1" runat="server" Text="规格型号："></asp:Label>
                </th>
                <td>
                    <asp:Label ID="lblGg" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <th style="width: 100px;">
                    <asp:Label ID="lblMaterial1" runat="server" Text="材质："></asp:Label>
                </th>
                <td>
                    <asp:Label ID="lblMaterial" runat="server"></asp:Label>
                </td>
                <th style="width: 100px;">
                    <asp:Label ID="lblStatus" runat="server" Text="生产企业："></asp:Label>
                </th>
                <td>
                    <asp:Label ID="lblCompanyName_SC" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <th style="width: 100px;">
                    <asp:Label ID="Label2" runat="server" Text="投标企业："></asp:Label>
                </th>
                <td>
                    <asp:Label ID="lblCompanyName_ZB" runat="server"></asp:Label>
                </td>
                <th style="width: 100px;">
                    <asp:Label ID="Label4" runat="server" Text="采购限价："></asp:Label>
                </th>
                <td>
                    <asp:Label ID="lblBidPrice" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <th style="width: 100px;">
                    <asp:Label ID="Label3" runat="server" Text="采购医疗机构："></asp:Label>
                </th>
                <td colspan="3">
                    <asp:Label runat="server" ID="lblHospitalName"></asp:Label>
                </td>
            </tr>
        </table>
    </div>
    <br />
    <asp:GridView ID="gvwCompany" runat="server" AutoGenerateColumns="False" EmptyDataText="暂无符合条件的数据！"
        CssClass="mainlist" OnRowEditing="gvwCompany_RowEditing" OnRowUpdating="gvwCompany_RowUpdating"
        OnRowCancelingEdit="gvwCompany_RowCancelingEdit" 
        onrowdatabound="gvwCompany_RowDataBound">
        <Columns>
            <asp:TemplateField HeaderText="序号">
                <ItemTemplate>
                    <%#Container.DataItemIndex+1 %></ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="配送企业">
                <ItemTemplate>
                    <asp:Label runat="server" ID="txtCompanyName" Text='<%#Eval("CompanyName_PS") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="实际采购价">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Price", "{0:N4}") %>' Visible='<%# Convert.ToBoolean(Eval("DistributionIsUsing")) %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtCompanyIDPs" runat="server" Text='<%# Eval("CompanyID_PS") %>'
                        Visible="false"></asp:TextBox>
                    <asp:TextBox ID="txtPrice" runat="server" Text='<%# Bind("Price", "{0:N4}") %>' Width="50px"
                        onblur="javascript:return check_isdecimal();" onkeydown="javascript:return check_isdecimal();" Enabled="false"
                        CausesValidation="False" MaxLength="7"></asp:TextBox>
                </EditItemTemplate>
                <HeaderStyle Width="80px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="当前配送">
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" ImageUrl='~/lib/images/ico_yes.gif' ToolTip="默认配送企业"
                        Visible='<%# Convert.ToBoolean(Eval("DistributionIsUsing")) %>' />
                </ItemTemplate>
                <HeaderStyle Width="60px" />
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False" HeaderText="操作">
                <ItemTemplate>
                    <asp:LinkButton ID="lbtnModify" runat="server" CausesValidation="False" CommandName="Edit"
                          Text='<%# Convert.ToBoolean(Eval("DistributionIsUsing"))?"":"设为当前配送" %>'  Enabled='<%# Convert.ToBoolean(Eval("DistributionIsUsing"))?false:true %>'></asp:LinkButton>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                        Text="确定"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                        Text="取消"></asp:LinkButton>
                </EditItemTemplate>
                <HeaderStyle Width="80px" />
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <div class="listip">
        <ul>
            <li>说明：<span style="color: red">竞价限价产品的配送企业一旦设置将不可修改，请谨慎设置！</span>
            </li>
        </ul>
    </div>
    <input id="hfdHospitalInfo" name="hfdHospitalInfo" type="hidden" runat="server" />
    <div class="listctrl">
        &nbsp;&nbsp;
   <%--     <input id="btnBack" type="button" value="返 回" onclick="javascript:window.location.href='<%=this.ReturnUrl %>'"
            class="btn" />--%>
            <input id="Button1" type="button" value="返 回" onclick="javascript :history.back(-1);"
            class="btn" />
    </div>
</asp:Content>
